const promise = new Promise((resolve, reject) => {
  console.log(1, 'promise done.');
  resolve();
});

promise.then(() => {
  console.log('resolved.');
}, (err) => {
  console.log(err);
});

console.log(2);